
__kernel void mvm_0(__global float * matrix, __const int num_rows, __const int nonzeros_per_row, __global float * vec_in, __global float * vec_out, __global int * col_idx) {
  
	const int idx = get_global_id(0);
	
	if (idx >= num_rows)
		return;

	float sum = 0.0f;
	int _row = idx;
	

	for (int i = nonzeros_per_row * idx; i < (nonzeros_per_row * (idx + 1)); i++) {
		int _col = col_idx[i];
		float _val = matrix[i];
		sum = sum + (_val * vec_in[_col]);
	}	

	vec_out[_row] = sum;	
}
